
//
//  FifthCell.m
//  房源、商铺、写字楼详情页
//
//  Created by MB__Lee on 2018/5/23.
//  Copyright © 2018年 MB__Lee. All rights reserved.
//

#import "FifthCell.h"

@interface FifthCell()

@property (weak, nonatomic) IBOutlet UIImageView *imgV;

@property (weak, nonatomic) IBOutlet UILabel *memberNameLabel;
@property (weak, nonatomic) IBOutlet UILabel *dealNumLabel;
@property (weak, nonatomic) IBOutlet UILabel *lookNumLabel;

@end

@implementation FifthCell

- (void)awakeFromNib {
    [super awakeFromNib];
    // Initialization code
    self.imgV.layer.cornerRadius = self.imgV.bounds.size.width * 0.5;
    self.imgV.clipsToBounds = YES;
    
}
-(void)setModel:(MBFangDetailModel *)model{
    
    [super setModel:model];
    
    // 设置会员头像
    [self.imgV sd_setImageWithURL:[NSURL URLWithString:model.member_avatar] placeholderImage:[UIImage imageNamed:@"touxiang_icon"]];
    self.memberNameLabel.text  = model.member_name; //设置会员名称
    
    self.dealNumLabel.attributedText  = [self getAttributedStringWithModel:model.member_deal_num forwordString:@"30天成交(套):"];
    self.lookNumLabel.attributedText  =[self getAttributedStringWithModel:model.member_look_num forwordString:@"30天看房(次):"];
    
}
-(NSAttributedString *)getAttributedStringWithModel:(NSString *)dealNum forwordString:(NSString *)forwordString{
    NSString *allString = [NSString stringWithFormat:@"%@%@",forwordString,dealNum];
    
    
    NSMutableAttributedString *att  =[[NSMutableAttributedString alloc] initWithString:allString attributes:nil];
    [att setAttributes:@{NSForegroundColorAttributeName:MBLineColor,NSFontAttributeName:MBFont(13)} range:NSMakeRange(0, 9)];
    
    [att setAttributes:@{NSForegroundColorAttributeName:MB_mainSelectedColor,NSFontAttributeName:MBFont(17)} range:NSMakeRange(9, 1)];
    
    return  att;
    
}

- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
    [super setSelected:selected animated:animated];

    // Configure the view for the selected state
}

@end
